<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../stylesheet.css" type="text/css"> 
<title>Szkoła jazdy :: Rejestracja</title>
</head>
<body>
<div id="top">
<div id="HEADER"> </div>
<p>pub/register.jsp</p>
<%@ include file="menu.jsp"%>

<c:if test="${success!='true'}">	
<table>
<form:form modelAttribute="customer">
	<tr><td>Login: </td><td><form:input path="username" maxlength="15" /><form:errors path="username" />
	<c:if test="${usernameInUse=='true'}">
		Login jest już używany. Wybierz inny.
	</c:if>
	</td></tr>
	<tr><td>Hasło: </td><td><form:password path="password" maxlength="32" /><form:errors path="password" /></td></tr>
	<tr><td>Imię: </td><td><form:input path="firstName" maxlength="20" /><form:errors path="firstName" /></td></tr>
	<tr><td>Nazwisko: </td><td><form:input path="lastName" maxlength="30" /><form:errors path="lastName" /></td></tr>
	<tr><td>Ulica: </td><td><form:input path="street" maxlength="28" /><form:errors path="street" /></td></tr>
	<tr><td>Nr: </td><td><form:input path="buildingNumber" maxlength="4" size="7"/><form:errors path="buildingNumber" /> m.
	<form:input path="apartmentNumber" maxlength="4" size="6"/><form:errors path="apartmentNumber" /></td></tr>
	<tr><td>Kod pocztowy: </td><td><form:input path="postalCode" maxlength="6" /><form:errors path="postalCode" /></td></tr>
	<tr><td>Miasto: </td><td><form:input path="city" maxlength="20" /><form:errors path="city" /></td></tr>
	<tr><td>Data urodzenia: </td><td><form:input path="dateOfBirth" maxlength="10" /><form:errors path="dateOfBirth" /></td></tr>
	<tr><td>E-mail: </td><td><form:input path="email" maxlength="30" /><form:errors path="email" /></td></tr>
	<tr><td>Numer telefonu: </td><td><form:input path="phoneNumber" maxlength="12" /><form:errors path="phoneNumber" /></td></tr>
	
	<tr><td><input type="submit" value="Wyślij" /></td><td></td></tr>
</form:form>
</table>
</c:if>

<c:if test="${success=='true'}">
<p>Rejestracja przebiegła pomyślnie!</p>
</c:if>
<div id="FOOTER">Pinky &amp; Mózg Inc. Dejta Bejses Prodżekt</div>
</div>
</body>
</html>